import { Service, Inject } from "typedi";
import { ClassListService } from "../ClassListService";
import { HomeServiceImpl } from "./HomeServiceImpl";
import { ClassListDao } from "../../dao/ClassListDao";
import { ThinkEntity } from "../../entity/ThinkEntity";
import { BannerEntity } from "../../entity/BannerEntity";

@Service()
export class ClassListServiceImpl implements ClassListService{

    protected static principalData:Array<{id:number,title:string}>;
    protected static additionalData:Array<{id:number,title:string}>;

    @Inject()
    private  ClassListDao!: ClassListDao;
    @Inject()
    private  HomeServiceImpl!: HomeServiceImpl;


    public async getClassScreen(entity_name:string):Promise<any>{

      
        return await this.ClassListDao.getClassScreen(entity_name);
    }

    public async getClassListValue(params:any):Promise<any>{
        let thinkData :ThinkEntity[] = [];
        let bannerData:BannerEntity[] = [];
        switch(params.classList_name){
            case '分画作':
                thinkData = await this.ClassListDao.getPaintThink(params)
                bannerData = await this.HomeServiceImpl.getBanner(2)
                return {thinkData,bannerData };
            case '分古籍':
                thinkData = await this.ClassListDao.getAncientThink(params)
                bannerData = await this.HomeServiceImpl.getBanner(3)
                return {thinkData,bannerData};
            default:
                return [];

        }
    }

    

}